package com.whh.spring.ioc.beans.support;

import com.whh.spring.ioc.beans.config.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {
    Map<String, Object> singletons = new HashMap<String, Object>();
    @Override
    public Object getSingleton(String beanName) {
        return singletons.get(beanName);
    }

    protected void addSingleton(String beanName, Object singleton) {
        singletons.put(beanName, singleton);
    }
}
